<template>
  <div style="width: 45%; margin: 0px auto">
    <el-card class="box-card">
      <div slot="header" class="clearfix" style="text-align: center">
    <span style="color: black;
                    font-size: 30px;
                    font-weight: 800;
                    font-family: 华文仿宋;">
                    个人信息
                </span>
      </div>
      <el-form ref="form1" :model="form1" label-width="80px" style="margin-left: 60px;height: 50px"
               label-position="left">
<!--        <el-tabs tab-position="top" style="margin-right: 40px" type="card" @tab-click="handleClick">-->
<!--          <el-tab-pane label="基本信息" name="first"></el-tab-pane>-->
<!--        </el-tabs>-->
        <div v-if="this.switch==='form1'">
          <el-row>
            <el-col :span="12">
              <el-form-item label="姓名" prop="name">
                <el-input v-model="form1.name" style="width: 70%" size="small"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别" prop="sex">
                <el-switch v-model="form1.sex" active-text="男" inactive-text="女"
                           active-value="male"
                           inactive-value="female"></el-switch>

              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="年龄" prop="age">
                <el-select v-model="form1.age" placeholder="请选择" style="width: 70%;">
                  <el-option
                      v-for="item in 100"
                      :key="item"
                      :label="item"
                      :value="item">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性格特征" prop="personality">
                <el-select v-model="form1.personality" style="width: 70%;">
                  <el-option label="外向型" value="外向型"></el-option>
                  <el-option label="内向型" value="内向型"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item style="margin-left: 35px">
              <el-button type="info" round @click="clear">清空</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item>
              <el-button type="primary" round @click="save">保存</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>


    </el-card>
  </div>
</template>

<script>
export default {
  name: "BasicInform",
  data() {
    return {
      switch: "form1",
      form1: {
        name: '',
        personality: '',
        age: '',
        sex: "female",
        type: [],
        resource: '',
        medicalfam: '',
        food: "",
        flavour: "",
        region: ""
      },
    }
  },
  methods: {
    clear() {
      this.$refs['form1'].resetFields()
    },
    save() {
      this.$root.$emit("stepvalue", 2);//点击保存后，跳转到症状描述
    },
    handleClick(tab, event) {
      console.log("dadadadsadasd")
      console.log(tab, event);
      if (tab.name === 'first') {
        this.switch = "form1"
      } else {
        this.switch = 'form2'
      }
    }
  }
}
</script>

<style scoped>

</style>
